import React, { Component } from 'react'
import style from './orderList.scss'
import common from '../../../../../../js/utils/common'

export default class OrderList extends Component {
	constructor(props) {
		super(props);
		this.state = {
		}
	}

	// static propTypes = {
    //     data: React.PropTypes.array //值
	// };
	
	render() {
		 console.log(this.props.data)
		let item = this.props.data,
			occurTime = common.format(item.occurTime,'yyyy-MM-dd'),
			newLoation = '';
			if (item.locationName == '') {
				if (item.location.length > 5)
					newLoation = item.location.substring(0, 5) + '...';
				else
					newLoation = item.location;
			}
			else{
				newLoation = item.locationName + '违章';
			}
				
		return (
			<div>
				<div className={style.listItme}>
					<div className={style.title}>
						<span>{item.carNumber} {newLoation}</span>
						<span>{occurTime}</span>
					</div>
					<div className={style.result}>
						罚款本金¥{item.fine}，
						办理服务费¥<span>
							{
								item.cooperPoundge !=null && item.cooperPoundge !=0?
									 item.cooperPoundge:item.pounDage
							}
						</span>
					</div>
					<div className={style.explain}>
						{
							// item.canProcess== 1 && item.degree> 0 && item.other> 0?
							// 	`可在线办理，根据当地交管所的规定，本次处理需要扣${item.degree}分。`:
							// item.canProcess== 1 && item.degree> 0 && item.other== 0?
							// 	'可在线办理，因此地区当前违章类型不执行扣分政策，本次办理不扣分（在政策改变之前请尽快办理）':
							// item.canProcess== 1 && item.degree== 0?'':
							// item.canProcessMsg !=null ||item.canProcessMsg !=''?
							// 	item.canProcessMsg:''
							item.canProcessMsg
						}
						
					</div>
				</div>
				<div style={{height: '.15rem'}}></div>
			</div>
		)
	}
}



